package edu.zut.cs.software.perfect.manage.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import edu.zut.cs.software.perfect.base.domain.BaseEntity;
import edu.zut.cs.software.perfect.student.domain.Student;
import edu.zut.cs.software.perfect.teacher.domain.Teacher;

/**
 * @ClassName UserManager
 * @Description TODO
 * @Author wst
 * @Date 2020年5月29日 下午7:37:09
 * operate table for T_TEACHER,T_STUDENT
 * @Version 1.0
 */
@Table(name = "T_UESR_GROUP")
@Entity
public class UserGroup extends BaseEntity<Long> {
	
	@Override
	public boolean equals(Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}
	@Override
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
	}
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1393437050684588472L;

	public Teacher getTeacher() {
		return teacher;
	}
	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}
	public Student getStudent() {
		return student;
	}
	public void setStudent(Student student) {
		this.student = student;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	/**
	 * teacher
	 */
	@Column(name="UG_TEACHER")
	Teacher teacher;
	
	/**
	 * student
	 */
	@Column(name="UG_STUDENT")
	Student student;

	
	/*
	 * many UserGroup to one Administrator
	 */
	@ManyToOne
	@JoinColumn(name = "ADMINISTRATOR_ID")
	Administrator Administrator;
	
}
